﻿USE [master]
GO
/****** Object:  Database [aspnet4]    Script Date: 2/7/2014 12:29:12 PM ******/
CREATE DATABASE [aspnet4]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'aspnet-AccountFlow-20140124123827.mdf', FILENAME = N'C:\Lab\Database\aspnet-AccountFlow-20140124123827.mdf' , SIZE = 3136KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'aspnet-AccountFlow-20140124123827_log.ldf', FILENAME = N'C:\Lab\Database\aspnet-AccountFlow-20140124123827_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [aspnet4] SET COMPATIBILITY_LEVEL = 110
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [aspnet4].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [aspnet4] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [aspnet4] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [aspnet4] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [aspnet4] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [aspnet4] SET ARITHABORT OFF 
GO
ALTER DATABASE [aspnet4] SET AUTO_CLOSE ON 
GO
ALTER DATABASE [aspnet4] SET AUTO_CREATE_STATISTICS ON 
GO
ALTER DATABASE [aspnet4] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [aspnet4] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [aspnet4] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [aspnet4] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [aspnet4] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [aspnet4] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [aspnet4] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [aspnet4] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [aspnet4] SET  DISABLE_BROKER 
GO
ALTER DATABASE [aspnet4] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [aspnet4] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [aspnet4] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [aspnet4] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [aspnet4] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [aspnet4] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [aspnet4] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [aspnet4] SET RECOVERY SIMPLE 
GO
ALTER DATABASE [aspnet4] SET  MULTI_USER 
GO
ALTER DATABASE [aspnet4] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [aspnet4] SET DB_CHAINING OFF 
GO
ALTER DATABASE [aspnet4] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [aspnet4] SET TARGET_RECOVERY_TIME = 0 SECONDS 
GO
USE [aspnet4]
GO
/****** Object:  Table [dbo].[UserProfile]    Script Date: 2/7/2014 12:29:12 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserProfile](
	[UserId] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](max) NULL,
PRIMARY KEY CLUSTERED 
(
	[UserId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[webpages_Membership]    Script Date: 2/7/2014 12:29:12 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[webpages_Membership](
	[UserId] [int] NOT NULL,
	[CreateDate] [datetime] NULL,
	[ConfirmationToken] [nvarchar](128) NULL,
	[IsConfirmed] [bit] NULL,
	[LastPasswordFailureDate] [datetime] NULL,
	[PasswordFailuresSinceLastSuccess] [int] NOT NULL,
	[Password] [nvarchar](128) NOT NULL,
	[PasswordChangedDate] [datetime] NULL,
	[PasswordSalt] [nvarchar](128) NOT NULL,
	[PasswordVerificationToken] [nvarchar](128) NULL,
	[PasswordVerificationTokenExpirationDate] [datetime] NULL,
PRIMARY KEY CLUSTERED 
(
	[UserId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[webpages_OAuthMembership]    Script Date: 2/7/2014 12:29:12 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[webpages_OAuthMembership](
	[Provider] [nvarchar](30) NOT NULL,
	[ProviderUserId] [nvarchar](100) NOT NULL,
	[UserId] [int] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[Provider] ASC,
	[ProviderUserId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[webpages_Roles]    Script Date: 2/7/2014 12:29:12 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[webpages_Roles](
	[RoleId] [int] IDENTITY(1,1) NOT NULL,
	[RoleName] [nvarchar](256) NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[RoleId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED 
(
	[RoleName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[webpages_UsersInRoles]    Script Date: 2/7/2014 12:29:12 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[webpages_UsersInRoles](
	[UserId] [int] NOT NULL,
	[RoleId] [int] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[UserId] ASC,
	[RoleId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[webpages_Membership] ADD  DEFAULT ((0)) FOR [IsConfirmed]
GO
ALTER TABLE [dbo].[webpages_Membership] ADD  DEFAULT ((0)) FOR [PasswordFailuresSinceLastSuccess]
GO
ALTER TABLE [dbo].[webpages_UsersInRoles]  WITH CHECK ADD  CONSTRAINT [fk_RoleId] FOREIGN KEY([RoleId])
REFERENCES [dbo].[webpages_Roles] ([RoleId])
GO
ALTER TABLE [dbo].[webpages_UsersInRoles] CHECK CONSTRAINT [fk_RoleId]
GO
ALTER TABLE [dbo].[webpages_UsersInRoles]  WITH CHECK ADD  CONSTRAINT [fk_UserId] FOREIGN KEY([UserId])
REFERENCES [dbo].[UserProfile] ([UserId])
GO
ALTER TABLE [dbo].[webpages_UsersInRoles] CHECK CONSTRAINT [fk_UserId]
GO
USE [master]
GO
ALTER DATABASE [aspnet4] SET  READ_WRITE 
GO
